<?php
/**
 * Anything added to this helper will be available to all templates in the Intake controller.
 */

 function clean_variables_for_mail($fields)
 {
     $clean    = array();
     $patterns = array('!content-type:!i','!multipart/mixed!i','!boundary=!i',
                       '!bcc:!i','!cc:!i','!multi-part message in mime format!i',
                       '!to:!i','!from:!i');
     $replace  = '';
     foreach($fields as $field=>$value)
     {
         $value = preg_replace($patterns,$replace,$value);
         $clean[$field] = $value;
     }
     return $clean;

 }
?>